import React, {Component} from 'react';
import './index.less';
import {base, high} from 'nc-lightapp-front';

import language from '../../language';

const {NCModal, NCButton, NCTable} = base;
const {Header: NCModalHeader, Body: NCModalBody, Footer: NCModalFooter} = NCModal;

class ReptObjModal extends Component {
    constructor(props) {
        super(props);
        this.closeModal = this.closeModal.bind(this);
    }

    closeModal() {
        this.props.onClose && this.props.onClose();
    }

    render() {
        const {visible, columns, data} = this.props;
        return (
            <NCModal
                show={visible}
                onHide={this.closeModal}
                backdrop={'static'}
            >
                <NCModalHeader closeButton={true}>
                    {language['hi6007-000049']}{/* 国际化处理： 汇报对象*/}
                </NCModalHeader>
                <NCModalBody>
                    <NCTable
                        columns={columns}
                        data={data}
                        scroll={{x: true, y: true}}
                    />
                </NCModalBody>
                <NCModalFooter>
                    <NCButton colors="primary" onClick={this.closeModal}>
                        {language['hi6007-000004']}{/* 国际化处理： 确定*/}
                    </NCButton>
                </NCModalFooter>
            </NCModal>
        );
    }
}

export default ReptObjModal;
